// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_INV_COI
// * CreateDate    : 2014-06-05 18:30:07
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:07
// * LastChanger   : 2014-06-05 18:30:07
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class InvCoiEntity : EntityBase
    {
        public InvCoiTable TableSchema
        {
            get
            {
                return InvCoiTable.Current;
            }
		}
		
		public InvCoiEntity()
        {

        }
		
		public InvCoiEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.CoId = Convert.ToString(CommonFunctions.ToObject(dr["CO_ID"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.CurQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["CUR_QTY"]));
			this.ChkQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["CHK_QTY"]));
			this.LocationExId = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION_EX_ID"]));
			this.LocationId = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION_ID"]));
			this.Type = Convert.ToInt32(CommonFunctions.ToObject(dr["TYPE"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
        }
		
		public InvCoiEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.CoId = Convert.ToString(CommonFunctions.ToObject(dr["CO_ID"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.CurQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["CUR_QTY"]));
			this.ChkQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["CHK_QTY"]));
			this.LocationExId = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION_EX_ID"]));
			this.LocationId = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION_ID"]));
			this.Type = Convert.ToInt32(CommonFunctions.ToObject(dr["TYPE"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return InvCoiTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(InvCoiTable.C_ID)); }
            set { SetData(InvCoiTable.C_ID, value); }
        }
		
        [DataMember]
        public string CoId
        {
            get { return Convert.ToString(GetData(InvCoiTable.C_CO_ID)); }
            set { SetData(InvCoiTable.C_CO_ID, value); }
        }
		
        [DataMember]
        public string ProductId
        {
            get { return Convert.ToString(GetData(InvCoiTable.C_PRODUCT_ID)); }
            set { SetData(InvCoiTable.C_PRODUCT_ID, value); }
        }
		
        [DataMember]
        public decimal CurQty
        {
            get { return Convert.ToDecimal(GetData(InvCoiTable.C_CUR_QTY)); }
            set { SetData(InvCoiTable.C_CUR_QTY, value); }
        }
		
        [DataMember]
        public decimal ChkQty
        {
            get { return Convert.ToDecimal(GetData(InvCoiTable.C_CHK_QTY)); }
            set { SetData(InvCoiTable.C_CHK_QTY, value); }
        }
		
        [DataMember]
        public string LocationExId
        {
            get { return Convert.ToString(GetData(InvCoiTable.C_LOCATION_EX_ID)); }
            set { SetData(InvCoiTable.C_LOCATION_EX_ID, value); }
        }
		
        [DataMember]
        public string LocationId
        {
            get { return Convert.ToString(GetData(InvCoiTable.C_LOCATION_ID)); }
            set { SetData(InvCoiTable.C_LOCATION_ID, value); }
        }
		
        [DataMember]
        public int Type
        {
            get { return Convert.ToInt32(GetData(InvCoiTable.C_TYPE)); }
            set { SetData(InvCoiTable.C_TYPE, value); }
        }
		
        [DataMember]
        public string Remark
        {
            get { return Convert.ToString(GetData(InvCoiTable.C_REMARK)); }
            set { SetData(InvCoiTable.C_REMARK, value); }
        }
		
		#endregion
	}
	
	
}	

